<template>
  <div class="table_box_hy hf hybm">
    <div class="hybm_box">
      <div class="hybm_title">{{ this.$route.meta.title }}</div>
    </div>
    <div class="table_item_hy hybm_item">
      <el-table :data="tableData" stripe fit>
        <el-table-column prop="title" label="会议标题"> </el-table-column>
        <el-table-column prop="type" label="会议类型"> 
          <template slot-scope="scope">
            <span v-if="scope.row.type == 'mechanism'">机构会议</span>
            <span v-if="scope.row.type == 'user'">个人会议</span>
          </template>
        </el-table-column>
        <el-table-column prop="meet_start_date" label="会议时间"> </el-table-column>
        <el-table-column prop="meet_person" label="会议人数"> </el-table-column>
        <el-table-column prop="type" label="审核状态">
          <template slot-scope="scope">
            <span v-if="scope.row.check == 0">待审核</span>
            <span v-if="scope.row.check == 1">审核通过</span>
            <span v-if="scope.row.check == 2">审核拒绝</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text"
              >查看</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pagination_hy">
      <el-pagination
        hide-on-single-page
        background
        :pager-count="5"
        layout="prev, pager, next"
        @current-change="handleCurrentChange"
        :current-page="page"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      tableData: [],
      total: 0,
      page: 1,
    };
  },
  mounted() {
    this.getinfo();
  },
  methods: {
    /**
     * 分页
     * @param {页码} page
     */
    handleCurrentChange(page) {
      // 当分页发生变化时的处理函数
      this.page = page;
      this.getinfo();
    },
    /**
     * 获取列表
     */
    getinfo() {
      let that = this;
      let data = {
        type:1,
        page: that.page,
      };
      that.$http.post("meet/history_list", data).then((res) => {
        if (res.code === 1) {
          that.total = res.data.total;
          that.tableData = res.data.data;
        } else {
          that.total = 0;
          that.tableData = [];
        }
      });
    },
    /**
     *  查看详情
     * @param {插槽数据} e
     */
    handleClick(e) {
      this.$router.push({ path: "/hybmjlxq_1", query: { id: e.id } });
    },
  },
};
</script>
  <style>
.hybm {
  border: 1px solid #ddd;
  background: #ffffff;
  border-radius: 0.125rem;
  box-shadow: 1px 1px 3px 2px rgba(0, 0, 0, 0.15);
  padding-bottom: 0.375rem;
}
.hybm_box {
  height: 0.7625rem;
  display: flex;
  align-items: center;
  border-bottom: 0.0125rem solid #1954a4;
  padding-left: 0.25rem;
  box-sizing: border-box;
}
.hybm_title {
  border-left: 0.05rem solid #1954a4;
  padding-left: 0.1375rem;
  box-sizing: border-box;
  font-size: 0.25rem;
  font-weight: 400;
  color: #1954a4;
}
.hybm_item {
  width: 14rem;
  margin: auto;
  padding-top: 0.1725rem;
}
</style>
<style scoped>
::v-deep .el-table tr{
  font-size: 0.2rem;
}
::v-deep .el-button{
  font-size: 0.2rem;
}
</style>